{% extends "base.html" %}
{% load static %}
{% block title %}修改学生信息{% endblock %}
{% block css %}
    <link href="{% static 'css/layui.css' %}" rel="stylesheet">
{% endblock %}
{% block content %}
    <div class="layui-container">
        <blockquote class="layui-elem-quote">
            <h1>修改学生信息</h1>
        </blockquote>

        <div class="layui-row">
        {%for student in studentdata%}
            <div class="layui-col-md5">
                <form action="/update_student/" method="post" enctype="multipart/form-data"/>

                    <input type="text" name="tId" id="tId" placeholder="学号" class="layui-input" value="{{ student.student_id}}"/>
                    <hr class="layui-bg-green">

                    <input type="text" name="tName" id="tName" placeholder="姓名" class="layui-input" value="{{ student.name}}"/>
                    <hr class="layui-bg-green">

                    <input type="text" name="tAge" id="tAge" placeholder="年龄" class="layui-input" value="{{ student.age }}"/>
                    <hr class="layui-bg-green">

                    <select name="tSex" id="tSex" value="">
                        <option value="{{ student.sex }}">{{ student.sex }}</option>
                         {% if student.sex == "男" %}
                            <option value="女">女</option>
                         {% else %}
                             <option value="男">男</option>
                         {% endif %}
                    </select>
                    <hr class="layui-bg-green">

                    <input type="file" name="tImage" id="tImage"/>
                    <hr class="layui-bg-green">

                    <img src="{{ student.image }}" height="50px">
                    <hr class="layui-bg-green">
                    <input type="submit" value="修改" class="layui-btn"/>
                </form>
            </div>
        </div>
        {% endfor %}
    </div>
{% endblock %}